<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simModifyGhost</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1><a href="../apiOverview.htm">Regular API</a> function</h1>
<h3 class=subsectionBar><a name="simModifyGhost" id="simModifyGhost"></a>simModifyGhost / sim.modifyGhost </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Modifies or removes a ghost object previously added with <a href="simAddGhost.htm">sim.addGhost</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simModifyGhost(simInt ghostGroup,simInt ghostId,simInt operation,simFloat floatValue,simInt options,simInt optionsMask,const simFloat* colorOrTransformation)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>ghostGroup</strong>: an identifier that allows, together with <strong>ghostId</strong>, identifying which ghosts to modify.</div>
<div><strong>ghostId</strong>: an identifier that allows, together with <strong>ghostGroup</strong>, identifying which ghosts to modify. If -1, then all ghosts that match <strong>ghostGroup</strong> will be modified.</div>
<div><strong>operation</strong>: a value indicating the operation to perform:</div>
<div class=tab><strong>0</strong>: no operation is performed, and the return value indicates the number of ghosts that match the identifiers.</div>
<div class=tab><strong>1</strong>: removes the specified ghosts. The return value indicates the number of removed ghosts.</div>
<div class=tab><strong>2</strong>: sets the start time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>3</strong>: sets the end time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>4</strong>: shifts the start time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>5</strong>: shifts the end time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>6</strong>: shifts the start and end times (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>7</strong>: scales the start time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>8</strong>: scales the end time (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>9</strong>: scales the start and end times (via <strong>floatValue</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>10</strong>: modifies the attributes (via <strong>options</strong> and <strong>optionsMask</strong>) of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>11</strong>: pre-multiplies (via <strong>colorOrTransformation</strong>) the transformations of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>12</strong>: post-multiplies (via <strong>colorOrTransformation</strong>) the transformations of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>13</strong>: modifies (via <strong>colorOrTransformation</strong>) the color of the specified ghosts. The return value indicates the number of modified ghosts.</div>
<div class=tab><strong>14</strong>: sets the transparency factor (via <strong>floatValue</strong>) of the specified ghosts. Only ghosts with custom colors will be influenced. The return value indicates the number of modified ghosts.</div>

<div><strong>floatValue</strong>: a floating point value that is used to modify the specified ghosts. See <strong>operation</strong> here above.</div>
<div><strong>options</strong>: the attributes used to modify the specified ghosts (see <strong>operation</strong> here above). Attributes are bit-coded:</div>
<div class=tab><strong>bit0</strong> reserved
<div class=tab><strong>bit1</strong> set (2)=the provided start- and end-times will be played-back in real-time</div>
<div class=tab><strong>bit2</strong> set (4)=preserve the original colors</div>
<div class=tab><strong>bit3</strong> reserved</div>
<div class=tab><strong>bit4</strong> set (16)=create an invisible ghost</div>
<div class=tab><strong>bit5</strong> set (32)=backface culling for the ghost (only when using custom colors)</div>

<div><strong>optionsMask</strong>: a mask allowing to select options to set.</div>
<div><strong>colorOrTransformation</strong>: a pointer to 7 or 12 float values: when <strong>operation</strong> is 11 or 12, 7 values indicating a transformation should be provided (x,y,z,qx,qy,qz,qw). when <strong>operation</strong> is 13, 12 values indicating a color should be provided (ambient_diffuse RGB, 3 reserved values (set to zero), specular RGB and emissive RGB). Can be nullptr when operation is different from 11, 12 or 13.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful, otherwise a value depending on the <strong>operation</strong> performed.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>number result=sim.modifyGhost(number ghostGroup,number ghostId,number operation,number floatValue,number options=nil,number optionsMask=nil,table colorOrTransformation=nil)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
<div></div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
<div></div></td> 
</tr> 
</table> 

<br>
<p><a href="../apiFunctions.htm">All regular API functions on one page</a></p>
<br>
<br>
</td>
</tr>
</table>
</div>
</body>
</html>
